package com.jiayuge.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 功能: 路由请求链接跳转  controller层
 * <p>路由请求链接跳转  controller层</p >
 * <ul>
 * <li>数据库: 增 删 改 查 </li>
 * <li>{@link RouterController} connect to {@link RouterController}</li>
 * </ul>
 *
 * @Program: SpringSecurity
 * @Date: 2021-10-13 10:44
 * @Version 1.0
 * @Author Jiayu.Yang
 */
@Controller
public class RouterController {

    //首页跳转
    @RequestMapping({"/","/index"})
    public String index(){
        return "index";
    }

    //登录页面跳转
    @RequestMapping("/login")
    public String toLogin(){
        return "views/login";
    }

    //登录页面跳转
    @RequestMapping("/logout")
    public String logout(){
        return "views/login";
    }

    @RequestMapping("/level{id1}/{id2}")
    public String level(@PathVariable("id1") int id1,@PathVariable("id2") int id2){
        return "views/level"+id1+"/"+id2;
    }
}
